<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
<h:head>
  <title><ui:insert name="title">Default title</ui:insert></title>
 

</h:head>

<body>
	<h:form>
		<p:panelGrid columns="2">  
		    <f:facet name="header">  
		        Resize Image 
		    </f:facet>  
  
		    <h:outputLabel for="width" value="Width: " />  
		    <p:inputText id="width" value="#{imageHandlerBean.width}" required="true" label="Width" />  
		  
		    <h:outputLabel for="height" value="Height:" />  
		    <p:inputText id="height" value="#{imageHandlerBean.height}" required="true" label="Height"/>		     
        
		    <f:facet name="footer">  
		 	<h:outputText value="Choose provider"/>
				<p:selectOneButton id="options" value="#{imageHandlerBean.provider}">  
	            	<f:selectItem itemLabel="Blitline" itemValue="blitline" />  
	            	<f:selectItem itemLabel="Cloudinary" itemValue="cloudinary" />  
	            	<f:selectItem itemLabel="Google" itemValue="Google" /> 
	        	</p:selectOneButton>    
        		<br></br>		       
		    </f:facet>  
		</p:panelGrid>  
		<h:commandButton value="resize" action="#{imageHandlerBean.resize}" ></h:commandButton> 
		</h:form>
		<b>Original Image</b>
		<br></br>
		<img src="fotis_image.jpg"/>
	 	<img src="#{imageHandlerBean.imagePath}"/>  

		
		
				
		 
   
 </body>

</html>
